<extend name="Base/common"/>
<block name="style">
    <style>
        a{color:#4f80a1}
        /*.main-wrapper{background: url(/Public/images/bg.jpg);background-size: 100%}*/
        /*.container{min-height: 520px}*/
    </style>
</block>
<block name="header">
</block>
<block name="body">
    <div class="container" style="min-height: 400px;">
        <div class="row">
            <div class="col-xs-12">
                <div class="common_block_border" style="border: 1px solid #bad2f6;">
                    <div class="col-md-12" style="padding: 0">
                        <img src="/Public/images/top_bg.png?v=1.1" alt="">
                    </div>
                    <div class="common_block_title">体检预约列表</div>
                    <div style="padding:0 20px 10px">
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>名称</th>
                                <th>预约开始时间和预约结束时间</th>
                                <th>查体开始时间和查体结束时间</th>
                                <th>报名查体时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <php>$time = strtotime(date('Y-m-d'));</php>
                            <notempty name="list">
                                <volist name="list" id="data">
                                    <tr <if condition="$data['end_time'] gt $time">class="success"</if>>
                                        <td>{$data.name}</td>
                                        <td>{$data.reserve_start_time|time_format='Y-m-d'}至{$data.reserve_end_time|time_format='Y-m-d'}</td>
                                        <td>{$data.check_start_time|time_format='Y-m-d'}至{$data.check_end_time|time_format='Y-m-d'}</td>
                                        <egt name="data.status" value="1">
                                        <td>{$data.chealth_time|time_format='Y-m-d'}</td>
                                        <else/>
                                        <td></td>
                                        </egt>
                                        <td>{$data.status_text|default=未报名}</td>
                                        <td>
                                            <if condition="($data['reserve_start_time'] elt $time) AND empty($data['status_text']) AND ($data['reserve_end_time'] egt $time)">
                                                <a href="{:U('enter', array('aid'=>$data['id']))}">报名</a>
                                            <else/>
                                                <eq name="data['status']" value="0">
                                                <p>不在预约时间</p>
                                                </eq>
                                            </if>
                                            <if condition="$data['allow_edit'] eq 1">
                                                <a href="{:U('editEnter', array('aid'=>$data['aid']))}">修改预约时间(可修改<php>echo C('LIMIT_UPDATE_NUM') - $data['update_num']</php>次)</a>
                                            <else />
                                                <p>{$data['allow_edit_info']}</p>
                                            </if>
                                            <if condition="$data['status'] eq 4" >
                                                <notempty name="data.file1" >
                                                <a href="{:U('download', array('id'=>$data['id'],'fid'=>$data['file1']))}">下载普通体检报告</a>
                                                </notempty>
                                                <notempty name="data.file2" >
                                                    <a href="{:U('download', array('id'=>$data['id'],'fid'=>$data['file2']))}">下载妇科体检报告</a>
                                                </notempty>
                                            </if>
                                        </td>
                                    <tr>
                                </volist>
                            <else/>
                                <tr><td colspan="4" align="center" class="warning">暂无可预约体检记录</td></tr>
                            </notempty>

                            </tbody>
                        </table>
                        <div class="text-right">
                            {:getPagination($totalCount,20)}
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</block>
<block name="script">
<notempty name="notices">

<script>

</script>
</notempty>
</block>